package com.ali.thread;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class MyRunnable implements Runnable {
    @Override
    public void run() {
        //获取当前线程对象
        Thread thread = Thread.currentThread();
        //获取线程名称
        String threadName = thread.getName();
        log.info("线程名：" + threadName);
        for (int i = 1; i < 10; i++) {
            System.out.println(threadName + "：" + i);
        }
    }
}
